package com.ssyx.home.feign;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ssyx.model.product.Category;
import com.ssyx.model.product.SkuInfo;
import com.ssyx.vo.product.SkuInfoVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * ClassName:ProductFeignClient
 * Description:
 *
 * @Author kay
 * @Create 2024/5/15 17:12
 * @Version 1.0
 */
@FeignClient(value = "service-product")
public interface ProductFeignClient {

    //获取分类信息
    @GetMapping("/api/product/inner/findAllCategoryList")
    List<Category> findAllCategoryList();

    //获取新人专享
    @GetMapping("/api/product/inner/findNewPersonSkuInfoList")
    List<SkuInfo> findNewPersonSkuInfoList();

    //获取销量高的商品
    @GetMapping("/api/product/inner/findMaxStockList")
    List<SkuInfo> findMaxStockList();


    //根据仓库id + 分类id 进行查询
    @GetMapping("/api/product/inner/findByWareIdAndCategoryId/{categoryId}/{wareId}/{page}/{limit}")
    Page<SkuInfo> findByWareIdAndCategoryId(@PathVariable Long categoryId,
                                            @PathVariable Long wareId,
                                            @PathVariable Long page,
                                            @PathVariable Long limit);


    //根据仓库id + keyword 查询
    @GetMapping("/api/product/inner/findByWareIdAndKeyword/{keyword}/{wareId}/{page}/{limit}")
    Page<SkuInfo> findByWareIdAndKeyword(@PathVariable String keyword,
                                         @PathVariable Long wareId,
                                         @PathVariable Long page,
                                         @PathVariable Long limit);

    //获取商品sku信息
    @GetMapping("/api/product/inner/getById/{id}")
    SkuInfoVo getById(@PathVariable Long id);

}